package com.ticket.system.service;

import java.util.List;

import com.ticket.common.core.domain.AjaxResult;
import com.ticket.system.domain.YanchuSeat;
import com.ticket.system.domain.YanchuSession;
import com.ticket.system.domain.vo.SeatCompareVo;
import com.ticket.system.domain.vo.SeatImportVo;
import com.ticket.system.domain.vo.SeatVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
 * 场次座位Service接口
 * 
 * @author ruoyi
 * @date 2023-09-26
 */
public interface IYanchuSeatService 
{
    /**
     * 查询场次座位
     * 
     * @param id 场次座位主键
     * @return 场次座位
     */
    public YanchuSeat selectYanchuSeatById(Long id);

    /**
     * 查询场次座位列表
     * 
     * @param yanchuSeat 场次座位
     * @return 场次座位集合
     */
    public List<YanchuSeat> selectYanchuSeatList(YanchuSeat yanchuSeat);

    public List<SeatVo> selectSeatVoList(Long sessionId);

    public List<SeatVo> selectSeatVoExportList(Long sessionId);

    /**
     * 新增场次座位
     * 
     * @param yanchuSeat 场次座位
     * @return 结果
     */
    public int insertYanchuSeat(YanchuSeat yanchuSeat);

    /**
     * 修改场次座位
     * 
     * @param yanchuSeat 场次座位
     * @return 结果
     */
    public int updateYanchuSeat(YanchuSeat yanchuSeat);

    /**
     * 批量删除场次座位
     * 
     * @param ids 需要删除的场次座位主键集合
     * @return 结果
     */
    public int deleteYanchuSeatByIds(Long[] ids);

    /**
     * 删除场次座位信息
     * 
     * @param id 场次座位主键
     * @return 结果
     */
    public int deleteYanchuSeatById(Long id);

    int initYanchuSeat(YanchuSession yanchuSession);

    int reservedYanchuSeat(YanchuSession yanchuSession);

    public List<YanchuSeat> grabTicket(Long sessionId,Long userId,List<SeatVo> seatVos,Long orderId);

    public void cancelTicketCache(Long sessionId);

    public Long selectCountSeatList(Long sessionId);

    public void refreshTicketCache(List<YanchuSeat> yanchuSeats);

    public YanchuSession selectSessionVo(Long sessionId);

    public List<YanchuSeat> grabNoPayTicket(Long sessionId,Long userId,List<SeatVo> seatVos,Long orderId);

    public void refreshTicketList(List<YanchuSeat> seatList,Long sessionId);

    /**
     * 导出座位列表  执行
     */
    public void executeExportOrder(List<SeatImportVo> list, HttpServletResponse response);

    public List<SeatImportVo> executeImportOrder(MultipartFile file);

    public AjaxResult grabBackendTicket(Long sessionId, Long userId, List<SeatVo> seatVos, Long orderId);

    public List<YanchuSeat> selectRowListByAreaId(Long idArea);

    public List<YanchuSeat> selectSeatListByRowNo(Long rowNumber,Long idArea);

    public void unBindRes(Long sessionId,List<SeatCompareVo> seatVos);

    public List<SeatCompareVo> selectResSeatVoList(Long sessionId);

    void delSessionSerialNo(Long sessionId);

    String getSessionSerialNo(Long sessionId);
}
